package data_structure;

public class leetcode_0242 {
    public boolean isAnagram(String s, String t) {
        char[] list1=s.toCharArray();
        char[] lsit2=t.toCharArray();
        int len1=list1.length;
        int len2=lsit2.length;
        int []list=new int[26];
        for(int i=0;i<len1;++i){
            list[list1[i]-'a']+=1;
        }
        for(int i=0;i<len2;++i){
            list[lsit2[i]-'a']-=1;

        }
        for(int i=0;i<26;++i){
            if(list[i]!=0) return false;
        }
        return true;
    }
}
